﻿@page "/daily/seal";
@namespace YwhWeb.Pages.Daily

<div style="text-align: right;">

    <PageContainer Title="印章管理" Style="right">
        <Content>   
            <Button @onclick="_=>NewDrawer()">添加会议</Button> 
            
            </Content>

        
            <ChildContent>
            <Table @ref="table"
                   TItem="YwhLib.Seal"
                   DataSource="@sealRsp.Items"
                   Total="_total"
                   @bind-PageIndex="_pageIndex"
                   @bind-PageSize="_pageSize"
                   @bind-SelectedRows="selectedRows"
                   OnChange="OnChange">
                <Selection Key="@(context.SealId.ToString())" />
                 <AntDesign.Column Title="记录ID" @bind-Field="@context.SealId" Sortable />
                 <AntDesign.Column Title="使用时间" @bind-Field="@context.DateTime" Format="yyyy-MM-dd HH:mm:ss" Sortable />
                 <AntDesign.Column Title="使用人" @bind-Field="@context.Name" />
                 <AntDesign.Column Title="使用原因" @bind-Field="@context.Reason" />
            </Table>
            </ChildContent>
    </PageContainer>
</div>

<Drawer Visible="this.drawerVisible" Width="500" OnClose="a=>{this.drawerVisible=false;}">
    <Title Level="4">添加记录</Title>
    <div>
    <p ></p>
 </div>

 <Text>使用时间:</Text>
    <div>
    <DatePicker TValue="DateTime" ShowTime="@true"
               DefaultValue=@editSeal.DateTime
               Format="yyyy-MM-dd HH:mm:ss"
               DisabledDate="date => date <= DateTime.Now"
               DisabledTime="date => GetDisabledTime(date)" 
               />
    <p></p>
</div>

<Text>使用人:</Text>
    <div>
    <AutoComplete @bind-Value="@editSeal.Name" Options="@options" OnSelectionChange="OnSelectionChange"  Placeholder=""/>
    <p></p>
</div>

<Text>使用原因:</Text>
<TextArea Rows="4" Placeholder="请输入使用原因" @bind-Value="@editSeal.Reason"/>
<p></p>

<div style="text-align: right;">
    <Button Type="@ButtonType.Primary">保存</Button>
</div>

</Drawer>